package com.smsc.headend.task.engine.service.collection;

import com.baomidou.mybatisplus.extension.service.IService;
import com.smsc.headend.module.data.entity.RdMeterReadsLp;
import com.smsc.headend.module.scheme.entity.ConfigAutoRecollectTask;
import com.smsc.headend.module.task.dto.AtomicTask;
import com.smsc.headend.module.task.dto.Task;
import com.smsc.headend.task.engine.exception.UDISTaskExecutorException;
import com.smsc.headend.task.engine.po.CollectDataDetailBo;
import com.smsc.headend.task.engine.po.RecollectInfo;

import java.util.List;
import java.util.Set;

/**
 * 补抄任务相关
 */
public interface RecollectTaskService extends IService<ConfigAutoRecollectTask> {

    void rescheduleRecollectTask(Task task, CollectDataDetailBo collectDataDetailBo, Integer executedTimes);

    boolean changeDetailIfRequired(Task task, AtomicTask atomicTask) throws UDISTaskExecutorException;

    CollectDataDetailBo handleRecollect(List<RdMeterReadsLp> readsLpList, String recollectTaskSeq, String targetPoint, Integer executeTime, String interval);

    Integer addAutoRecollectPlan(Long meterId, Long lpDataItemId, Long startTime, Long endTime, List<Long> absentPointTvList, Integer intervalTime, Integer dataPoints, String absentPointsData);

    int checkRecollectTask(Long meterId, Long interval, Set<Long> absentPointSet, Long lpDataItemId);

    void createRecollectTask(RecollectInfo recollectInfo);

    List<ConfigAutoRecollectTask> getRecollectTask(long lpDataItemId, long startTv, long endTv, long meterId);

    String saveChangedRecollectDetail(ConfigAutoRecollectTask configAutoRecollectTask, Set<Long> absentPoints);

    String getChangedRecollectDetail(Long seq);

    int generateRecollectTask(Long meterId, Long startTime, long progressTime, Long profileId, Integer interval);

    void persistRecollectTask(List<ConfigAutoRecollectTask> dtoList);
}
